-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: drop MapLibreGL
naming and deprecate export default
#567
Conversation
BREAKING CHANGE: Remove MapLibreGL default export, use `import * as MapLibreRN` instead
# Conflicts: # docs/components/BackgroundLayer.md # docs/components/CircleLayer.md # docs/components/FillExtrusionLayer.md # docs/components/FillLayer.md # docs/components/HeatmapLayer.md # docs/components/LineLayer.md # docs/components/MapView.md # docs/components/RasterLayer.md # docs/components/SymbolLayer.md # docs/docs.json # packages/examples/src/examples/UserLocation/FollowUserLocationRenderMode.tsx # src/MLRNModule.ts # src/components/MapView.tsx
MapLibreGL
naming and export default
I can understand migrating to named exports and updating the docs accordingly, but I am concerned about the extent of breaking changes, which are more significant than those listed in the migration docs. Because of the gap between 9.0 and 10.0, and the number of people using 10.0 beta in production, doing a patch bump on beta with this extent of breaking changes would break any app using beta in production. That is unacceptable IMO. My preference would be to support both for the 10.0 release. For example:
Would enable the new api, but allow current functionality to work without breaking changes. We can add a deprecation notice if need be, and remove them with the next Major release, but I don't think we can break this much API with a patch. |
I see your concern. These are the points, why it would rather break stuff now:
But I'm also fine to keep old exports as deprecated, just let me know which path you want to go. |
What do we gain from doing this? Other than following builder-bob recommendations. Is it more performant? Is it less error-prone? Does it provide greater functionality? Does it simplify the build configuration? While we have made minor api changes in alpha & beta, there were reasons for each. This breaks literally everything. Not just the methods you mentioned, but also AnimatedShape, Logger, LocationManager, SnapshotManager, etc. Updated exports across hundreds of files. Someone does a patch version bump on 10.0.0.beta, and if they are lucky, CI/CD catches it. It may be an easy migration with a couple find and replaces, but it is completely unnecessary. Why cause this level of frustration? I am sorry. I just don't get it. Why is this necessary? |
To me personally there is a handful of reasons to drop the default export. But I understand, these might be very subjective arguments. Therefore I will revert the breaking changes to deprecations. The following is the reasoning, why I want to deprecate the default exports. Please let me know if you are opposing a deprecation. Sorry, I should have communicated the reasonings behind this much more clearly. First of all, I think it's good to distinguish from the Most React libraries which export components use named imports in their docs/examples. But of course this doesn't require removing the user facing default export. But by unifying the way this library is used, reports and discussions in this repository could be more readable and more understandable to everyone. Taken from the Builder Bob docs:
Here are some clarifications of the possible issues.
I want to clarify: Changing the individual exports within For library users, mainly the changes in To conclude, changing the user facing exports in |
MapLibreGL
naming and export default
MapLibreGL
naming and deprecate export default
I've pushed the deprecations, now this PR only deprecates exports and introduces no new breaking changes. |
Perfect! Thank you. |
# Conflicts: # android/build.gradle
# [10.0.0-beta.13](v10.0.0-beta.12...v10.0.0-beta.13) (2024-12-23) ### Features * drop `MapLibreGL` naming and deprecate `export default` ([#567](#567)) ([aa0c73d](aa0c73d))
🎉 This PR is included in version 10.0.0-beta.13 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Merge #563 first.
As recommended by React Native Builder Bob I've removed default exports and generally removed wherever possible from the library. The resulting breaking changes are documented in the migration guide.